package com.woniuxy.gobang84.entity;

import java.io.Serializable;

import javafx.scene.paint.Color;

public class Piece implements Serializable{
	private double x;
	private double y;
	private transient Color color;
	public Piece(){
		
	}
	
	public Piece(double x, double y, Color color) {
		super();
		this.x = x;
		this.y = y;
		this.color = color;
	}

	public double getX() {
		return x;
	}
	public void setX(double x) {
		this.x = x;
	}
	public double getY() {
		return y;
	}
	public void setY(double y) {
		this.y = y;
	}
	public Color getColor() {
		return color;
	}
	public void setColor(Color color) {
		this.color = color;
	}
	@Override
	public String toString() {
		return "Piece [x=" + x + ", y=" + y + ", color=" + color + "]";
	}
	@Override
	public boolean equals(Object obj) {
		if(this==obj){
			return true;
		}
		if(obj instanceof Piece){
			Piece p=(Piece)obj;
			if(this.x==p.x && this.y==p.y 
					&& this.color.equals(p.color)){
				return true;
			}
		}
		return false;
	}
}
